package lxt.service.impl;

import java.util.List;

import lxt.dao.BorrowTruckDao;
import lxt.entity.BorrowTruckInfo;
import lxt.service.BorrowTruckService;

public class BorrowTruckServiceImpl implements BorrowTruckService {
	private BorrowTruckDao borrowTruckDao;
	/**
	 * 加载信息
	 */
	public List<BorrowTruckInfo> loadBorrowTruck(String truckId, String ownerName,String isPayed,
			int offset, int length) throws Exception {
		return this.borrowTruckDao.loadBorrowTruck(truckId, ownerName,isPayed,offset, length);
	}
	/**
	 * 查询数量
	 */
	public int loadAllBorrowTruckCount(String truckId,String ownerName,String isPayed)throws Exception{
		return this.borrowTruckDao.loadAllBorrowTruckCount(truckId, ownerName,isPayed);
	}
	/**
	 * 根据id加载
	 */
	public BorrowTruckInfo loadBorrowTruckById(String borrowTruckId)throws Exception {
		return (BorrowTruckInfo) this.borrowTruckDao.get(BorrowTruckInfo.class, borrowTruckId);
	}
	/**
	 * 修改结清状态
	 * @param id
	 * @return
	 */
	public boolean updateBorrowTruck(BorrowTruckInfo borrowTruck)throws Exception {
		this.borrowTruckDao.update(borrowTruck);
		return true;
	}
	
	/**
	 * get set
	 */
	public BorrowTruckDao getBorrowTruckDao() {
		return borrowTruckDao;
	}
	public void setBorrowTruckDao(BorrowTruckDao borrowTruckDao) {
		this.borrowTruckDao = borrowTruckDao;
	}
}
